      	SUBROUTINE sensib_OUTPT_OT(dudQ,dudQOT,numpar,numpc,ldfjac,
     &                    I_ELET,IDCASO,IC,NEPE,NCasos,N_eq)

	INCLUDE 'param_dim.inc'		
		
	double precision dudQ(N_eq,numpar),dudQOT(ldfjac,numpar)
	double precision aux(npar_max)
	
	INTEGER IDCASO(NCasosX,3),I_ELET(16,NELEX)

	IELET1= IDCASO(IC,1)
	IELET2= IDCASO(IC,2)
	IELET3= IDCASO(IC,3)

	IR0= (IC-1)*(16-3)
! 	IR0= (IC-1)*(16-2)
	IRES= 0
! 	write(*,*)'dudqOT'	
	DO IE= 1,16
		IF( (IE.NE.IELET1).AND.
!      &       	    (IE.NE.IELET3).AND.  ! A partir da modif da funcao objetivo usa-se o potencial do elet de ref
     &              (IE.NE.IELET2) ) THEN
			IRES = IRES + 1

			INOF = I_ELET(IE,1+NEPE/2)

			if(IE.NE.IELET3)then
				do j=1,numpar
					dudQOT(IR0+IRES,j) = dudQ(INOF,j)  !derivadas dos valores incognitos
				enddo
			else
				do j=1,numpar
					dudQOT(IR0+IRES,j) = 0. !derivadas do valor prescrito
				enddo		
			endif

		ENDIF
	ENDDO



!  Consequencia da regra da cadeia J(i,j) = DuDQOT(i,j) + 1/14* sum_k (DuDQOT(k,j)),k=1,14
! Dc/Dz_i = 1/14 para qq z_i



	do j = 1,numpar
		aux(j) = 0.
		do k = (IR0+1),(IR0+16-2)
			aux(j) = aux(j) + dudQOT(k,j)
		enddo
	enddo

	do i=(IR0+1),(IR0+16-2)
		do j=1,numpar
			dudQOT(i,j) = dudQOT(i,j) - (1./14.)*aux(j)
		enddo
	enddo

! 	do i=IR0+1,IR0+16-2
! 		write(4,2)(dudQOT(i,j),j=1,numpar)
! 	enddo




 1	format(i10,15f10.5)
 2	format(8f10.5)
	return
	end
